﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Oplug.CoolTower.DTO
{
    public class FinalResult
    {
        public double value { get; set; }
    }
    /// <summary>
    /// 选型程序输入参数
    /// </summary>
    public class InputParam
    {
        /// <summary>
        /// 必填参数，Water Flow  (循环水量）
        /// </summary>
        public double C5 { get; set; }
        public double C5cc
        {
            get
            {
                return C5 * 1000 / 3.785411784 / 60;
            }
        }
        public string C5IUM { get; set; } = "GPM";
        /// <summary>
        /// 必填参数，Hot Water Temp (进水温度）℃
        /// </summary>
        public double C6 { get; set; }
        public double C6cc
        {
            get
            {
                return 32 + 1.8 * C6;
            }
        }
        public string C6IUM { get; set; } = "℉";
        /// <summary>
        /// 必填参数，Cold Water Temp (出水温度）℃
        /// </summary>
        public double C7 { get; set; }
        public double C7cc
        {
            get
            {
                return 32 + 1.8 * C7;
            }
        }
        public string C7IUM { get; set; } = "℉";
        /// <summary>
        /// 必填参数，Wet Bulb Temp  (湿球温度）℃
        /// </summary>
        public double C8 { get; set; }
        public double C8cc
        {
            get
            {
                return 32 + 1.8 * C8;
            }
        }
        public string C8IUM { get; set; } = "℉";
        /// <summary>
        /// Heat Rejection (热负荷) kcal/hr
        /// </summary>
        public double C9
        {
            get
            {
                return C5 * 1000 * C10;
            }
        }
        public double C9cc
        {
            get
            {
                return C9 / 860;
            }
        }
        public string C9IUM { get; set; } = "KW";
        /// <summary>
        /// RANGE（温降）℃
        /// </summary>
        public double C10
        {
            get
            {
                return C6 - C7;
            }
        }
        public double C10cc
        {
            get
            {
                return 32 + 1.8 * C10;
            }
        }
        public string C10IUM { get; set; } = "℉";
        private double _C11;
        /// <summary>
        /// APPROCH（逼近度）℃
        /// </summary>
        public double C11
        {
            get
            {
                _C11 = C7 - C8;
                return _C11;
            }
            set
            {
                this._C11 = value;
            }
        }
        public double C11cc
        {
            get
            {
                return 32 + 1.8 * C11;
            }
        }
        public string C11IUM { get; set; } = "℉";
        /// <summary>
        /// Water-Air  Ratio L/G (水气比) 
        /// =(C5*1000)/(设备型号参数表!V12*1.293)
        /// </summary>
        public double C12 { get; set; }
        /// <summary>
        /// Rating Factor(选定系数）, 即FinalResult
        /// =插入法处理小数问题!L39
        /// </summary>
        public double C13 { get; set; }
        /// <summary>
        /// 相当参考标准点的冷却能力m3/h
        /// </summary>
        public double C14
        {
            get
            {
                return C5 / C13;
            }
        }
        /// <summary>
        /// 系统推荐使用型号标准能力m3/h
        /// =设备型号参数表!V5
        /// </summary>
        public double C15 { get; set; }
        /// <summary>
        /// Select Reserve（所选型号裕量）%
        /// </summary>
        public double C16 {
            get
            {
                return (C15 - C14) / C14;
            }
        }
        /// <summary>
        /// Select FBS Model（选定冷却塔型号）
        /// </summary>
        public string SelectedFBSModel { get; set; }
        /// <summary>
        /// Select Model（选定冷却塔型号）
        /// </summary>
        public string SelectedModel { get; set; }
    }
    public class CalcuModel
    {
        /// <summary>
        /// 真实逼近度
        /// </summary>
        public double B31 { get; set; }
        private double _b32;
        /// <summary>
        /// 真实逼近度向下取整
        /// </summary>
        public double B32
        {
            get
            {
                _b32 = Math.Round(B31, 0);
                return _b32;
            }
            set
            {
                this._b32 = value;
            }
        }
        private double _b33;
        /// <summary>
        /// 真实逼近度向上取整
        /// </summary>
        public double B33
        {
            get
            {
                _b33 = B32 + 1;
                return _b33;
            }
            set
            {
                this._b33 = value;
            }
        }
        /// <summary>
        /// 输入参数湿球温度
        /// </summary>
        public double B36 { get; set; }
        private double _b37;
        /// <summary>
        /// 取整湿球温度，即对B36取整
        /// </summary>
        public double B37 {
            get
            {
                _b37 = Math.Round(B36, 0);
                return _b37;
            }
            set
            {
                this._b37 = value;
            }
        }
        private double _b41;
        /// <summary>
        /// 往上取整湿球温度，即B37+1
        /// </summary>
        public double B41 {
            get
            {
                _b41 = B37 + 1;
                return _b41;
            }
            set
            {
                this._b41 = value;
            }
        }
        public double M31 { get; set; }
        public double M32 { get; set; }
        public double M33 { get; set; }
        public double I31 { get; set; }
        /// <summary>
        /// 根据综合标识 和 湿球温度 找出对应系数
        /// </summary>
        public double I32 { get; set; }
        public double I33 { get; set; }
        public double C32 { get; set; }
        public double C33 { get; set; }
        public double D37 { get; set; }
    }
    /// <summary>
    /// 设备型号模型
    /// </summary>
    public class t_equipment
    {
        /// <summary>
        /// 
        /// </summary>
        public int id { get; set; }
        /// <summary>
        /// FBS型号
        /// </summary>
        public string f_FBSModel { get; set; }

        /// <summary>
        /// 福玻斯型号
        /// </summary>
        public string f_Model { get; set; }

        /// <summary>
        /// CTI处理标准水量
        /// </summary>
        public int f_CTIDealWaterFlow { get; set; }

        /// <summary>
        /// 长度
        /// </summary>
        public int f_L { get; set; }

        /// <summary>
        /// 宽度
        /// </summary>
        public int f_W { get; set; }

        /// <summary>
        /// 高度
        /// </summary>
        public int f_H { get; set; }
        /// <summary>
        /// 直径
        /// </summary>
        public int f_D { get; set; }

        /// <summary>
        /// 风机功率
        /// </summary>
        public string f_KW { get; set; }

        /// <summary>
        /// 喷淋泵功率
        /// </summary>
        public string f_KW2 { get; set; }
        /// <summary>
        /// 设备进出水口管径
        /// </summary>
        public int f_DN { get; set; }

        /// <summary>
        /// 设备溢流口管径
        /// </summary>
        public int f_DN2 { get; set; }

        /// <summary>
        /// 设备排污口管径
        /// </summary>
        public int f_DN3 { get; set; }

        /// <summary>
        /// 设备污水口管径
        /// </summary>
        public int f_DN4 { get; set; }
        
        /// <summary>
        /// 风量
        /// </summary>
        public double f_m3h { get; set; }        

        /// <summary>
        /// 设备自重
        /// </summary>
        public int f_Kg { get; set; }

        /// <summary>
        /// 设备运行重量
        /// </summary>
        public int f_Kg2 { get; set; }
        public int enabled { get; set; }
        public int filterIndex {
            get
            {
                return enabled == 0 ? 999 : f_CTIDealWaterFlow;
            }
        }

    }
    /// <summary>
    /// 设备系数
    /// </summary>
    public class t_equparams
    {
        /// <summary>
        /// 
        /// </summary>
        public int id { get; set; }

        /// <summary>
        /// 湿球温度12°
        /// </summary>
        public double f_WetBulbTemp12 { get; set; }

        /// <summary>
        /// 湿球温度13°
        /// </summary>
        public double f_WetBulbTemp13 { get; set; }

        /// <summary>
        /// 湿球温度14°
        /// </summary>
        public double f_WetBulbTemp14 { get; set; }

        /// <summary>
        /// 湿球温度15°
        /// </summary>
        public double f_WetBulbTemp15 { get; set; }

        /// <summary>
        /// 湿球温度16°
        /// </summary>
        public double f_WetBulbTemp16 { get; set; }

        /// <summary>
        /// 湿球温度17°
        /// </summary>
        public double f_WetBulbTemp17 { get; set; }

        /// <summary>
        /// 湿球温度18°
        /// </summary>
        public double f_WetBulbTemp18 { get; set; }

        /// <summary>
        /// 湿球温度19°
        /// </summary>
        public double f_WetBulbTemp19 { get; set; }

        /// <summary>
        /// 湿球温度20°
        /// </summary>
        public double f_WetBulbTemp20 { get; set; }

        /// <summary>
        /// 湿球温度21°
        /// </summary>
        public double f_WetBulbTemp21 { get; set; }

        /// <summary>
        /// 湿球温度22°
        /// </summary>
        public double f_WetBulbTemp22 { get; set; }

        /// <summary>
        /// 湿球温度23°
        /// </summary>
        public double f_WetBulbTemp23 { get; set; }

        /// <summary>
        /// 湿球温度24°
        /// </summary>
        public double f_WetBulbTemp24 { get; set; }

        /// <summary>
        /// 湿球温度25°
        /// </summary>
        public double f_WetBulbTemp25 { get; set; }

        /// <summary>
        /// 湿球温度26°
        /// </summary>
        public double f_WetBulbTemp26 { get; set; }

        /// <summary>
        /// 湿球温度27°
        /// </summary>
        public double f_WetBulbTemp27 { get; set; }

        /// <summary>
        /// 湿球温度28°
        /// </summary>
        public double f_WetBulbTemp28 { get; set; }

        /// <summary>
        /// 湿球温度29°
        /// </summary>
        public double f_WetBulbTemp29 { get; set; }

        /// <summary>
        /// 湿球温度30°
        /// </summary>
        public double f_WetBulbTemp30 { get; set; }

        /// <summary>
        /// 湿球温度31°
        /// </summary>
        public double f_WetBulbTemp31 { get; set; }

        /// <summary>
        /// 湿球温度32°
        /// </summary>
        public double f_WetBulbTemp32 { get; set; }

        /// <summary>
        /// 逼近度
        /// </summary>
        public double f_approch { get; set; }

        /// <summary>
        /// 温降
        /// </summary>
        public double f_range { get; set; }
        /// <summary>
        /// 算法标识1
        /// </summary>
        public double suanfa1 { get; set; }
        /// <summary>
        /// 算法标识2
        /// </summary>
        public double suanfa2 {
            get
            {
                return f_range * 1000;
            }
        }
        /// <summary>
        /// 综合标识
        /// </summary>
        public double zonghe {
            get
            {
                return suanfa1 * 100000 + suanfa2 + f_approch * 10;
            }
        }
        public string intro { get; set; }

    }
}
